home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / bridge / Manual.rx < prev    next >
Text File  |  2001-12-03  |  6KB  |  307 lines

  1. /*     Manual */
  2.  
  3.     options results
  4.     parse ARG Port Ptr M0 M1 M2 M3 M4 M5 M6 b
  5.     
  6.     ADDRESS value Port
  7.  
  8.     pp_GetWidth
  9.     W=result;W2=W/2-1
  10.  
  11.     if W=0 then EXIT
  12.  
  13.     pp_GetHeight
  14.     H=result;H2=H/2-1
  15.  
  16. pp_AvoidRefresh
  17. pp_CloneObjectModeOn
  18.  
  19. IF Ptr=1|Ptr=2|Ptr=22 then DO
  20.     IF M0=1|M0=2|M0=22 THEN DO
  21.         X=M1;Y=M2;R=M3
  22.     END;ELSE;DO
  23.         X=W2;Y=H2
  24.         IF W>H THEN DO
  25.             R=H2
  26.         END;ELSE;DO
  27.             R=W2
  28.         END
  29.     END
  30.  
  31.     pp_DialogInit 150 100 "*Circle*" 3
  32.         pp_Integer 0 60 5 50 16 "X" 1 X
  33.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  34.         pp_Integer 2 60 50 50 16 "Radius" 1 R
  35.     pp_Dialog
  36.  
  37.     IF result~=0 THEN DO
  38.         pp_GetDialog 0;X=result
  39.         pp_GetDialog 1;Y=result
  40.         pp_GetDialog 2;R=result
  41.  
  42.         IF Ptr=1 then DO
  43.             pp_Circle X Y R
  44.         END;ELSE;DO
  45.             pp_CircleF X Y R
  46.         END
  47.     END
  48. END
  49.  
  50. IF Ptr=14 then DO
  51.     IF M0=14 THEN DO
  52.         X=M1;Y=M2
  53.     END;ELSE;DO
  54.         X=W2
  55.         Y=H2
  56.     END
  57.     pp_DialogInit 150 75 "*Text*" 2
  58.         pp_Integer 0 60 5 50 16 "X" 1 X
  59.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  60.     pp_Dialog
  61.  
  62.     IF result ~=0 THEN DO
  63.         pp_GetDialog 0;X=result
  64.         pp_GetDialog 1;Y=result
  65.         pp_TextDraw X Y
  66.     END
  67. END
  68.  
  69. IF Ptr=12|Ptr=13|Ptr=25 then DO
  70.     IF M0=12|M0=13|M0=25 THEN DO
  71.         X=M1;Y=M2;R=M3;R2=M4
  72.     END;ELSE;DO
  73.         X=W2;Y=H2;R=W2;R2=H2
  74.     END
  75.  
  76.     pp_DialogInit 150 125 "*Ellipse*" 4
  77.         pp_Integer 0 60 5 50 16 "X" 1 X
  78.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  79.         pp_Integer 2 60 50 50 16 "RadiusX" 1 R
  80.         pp_Integer 3 60 70 50 16 "RadiusY" 1 R2        
  81.     pp_Dialog
  82.  
  83.     IF result ~=0 THEN DO    
  84.         pp_GetDialog 0;X=result
  85.         pp_GetDialog 1;Y=result
  86.         pp_GetDialog 2;R=result
  87.         pp_GetDialog 3;R2=result
  88.  
  89.         IF Ptr=12 then DO
  90.             pp_Ellipse X Y R R2
  91.         END;ELSE;DO
  92.             pp_EllipseF X Y R R2
  93.         END
  94.     END
  95. END
  96.  
  97. IF Ptr=3|Ptr=4|Ptr=21 then DO
  98.     IF M0=3|M0=4|M0=21 THEN DO
  99.         X=M1;Y=M2;XX=M3;YY=M4
  100.     END;ELSE;DO
  101.         X=0;Y=0;XX=W-1;YY=H-1
  102.     END
  103.  
  104.     DO UNTIL rc>-1
  105.         pp_DialogInit 150 155 "*Box*" 5
  106.             pp_Integer 0 60 5 50 16 "Start*X" 1 X
  107.             pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  108.             pp_Integer 2 60 50 50 16 "End*X" 1 XX
  109.             pp_Integer 3 60 70 50 16 "End*Y" 1 YY
  110.             pp_Button 4 60 100 50 16 'Reset'        
  111.         pp_Dialog
  112.         rc=result
  113.         IF rc=-4 THEN DO
  114.             X=0;Y=0;XX=W-1;YY=H-1        
  115.         END        
  116.     END
  117.  
  118.     IF rc~=0 then DO
  119.         pp_GetDialog 0;X=result
  120.         pp_GetDialog 1;Y=result
  121.         pp_GetDialog 2;XX=result
  122.         pp_GetDialog 3;YY=result
  123.  
  124.         IF Ptr=3 then DO
  125.             pp_Box X Y XX YY
  126.         END;ELSE;DO
  127.             pp_BoxF X Y XX YY
  128.         END
  129.     END
  130. END
  131.  
  132. IF Ptr=6|Ptr=7|Ptr=24 then DO
  133.     IF M0=6|M0=7|M0=24 THEN DO
  134.         X=M1;Y=M2;XX=M3;YY=M4;XXX=M5;YYY=M6
  135.     END;ELSE;DO
  136.         X=0;Y=0;XX=W-1;YY=0;XXX=W2;YYY=H-1
  137.     END
  138.  
  139.     pp_DialogInit 150 175 "*Spline*" 6
  140.         pp_Integer 0 60 5 50 16 "Start*X" 1 X
  141.         pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  142.         pp_Integer 2 60 50 50 16 "End*X" 1 XX
  143.         pp_Integer 3 60 70 50 16 "End*Y" 1 YY        
  144.         pp_Integer 4 60 95 50 16 "MX" 1 XXX
  145.         pp_Integer 5 60 115 50 16 "MY" 1 YYY    
  146.     pp_Dialog
  147.         
  148.     IF result~=0 then DO
  149.         pp_GetDialog 0;X=result
  150.         pp_GetDialog 1;Y=result
  151.         pp_GetDialog 2;XX=result
  152.         pp_GetDialog 3;YY=result
  153.         pp_GetDialog 4;XXX=result
  154.         pp_GetDialog 5;YYY=result
  155.  
  156.         IF Ptr=6 then DO
  157.             pp_Spline X Y XX YY XXX YYY
  158.         END;ELSE;DO
  159.             pp_SplineF X Y XX YY XXX YYY
  160.         END
  161.     END
  162. END
  163.  
  164. IF Ptr=5|Ptr=20 then DO
  165.     IF M0=5|M0=20 THEN DO
  166.         X=M1;Y=M2;XX=M3;YY=M4
  167.     END;ELSE;DO
  168.         X=0;Y=0;XX=W-1;YY=H-1
  169.     END
  170.  
  171.     pp_DialogInit 150 125 "*Line*" 4
  172.         pp_Integer 0 60 5 50 16 "Start*X" 1 X
  173.         pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  174.         pp_Integer 2 60 50 50 16 "End*X" 1 XX
  175.         pp_Integer 3 60 70 50 16 "End*Y" 1 YY        
  176.     pp_Dialog
  177.         
  178.     IF result~=0 then DO
  179.         pp_GetDialog 0;X=result
  180.         pp_GetDialog 1;Y=result
  181.         pp_GetDialog 2;XX=result
  182.         pp_GetDialog 3;YY=result
  183.         pp_Line X Y XX YY
  184.     END
  185. END
  186.  
  187. IF Ptr=15|Ptr=16 then DO
  188.     pp_DialogInit 150 75 "*Polygon*" 2
  189.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  190.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  191.     pp_Dialog
  192.  
  193.     IF result~=0 then DO
  194.         pp_GetDialog 0;xx=result
  195.         pp_GetDialog 1;yy=result
  196.  
  197.         file="T:ppdata"
  198.         IF OPEN("g",file, "read") then
  199.         DO
  200.             tind = READLN("g")
  201.             pp_StartPoly
  202.             DO i=1 to tind
  203.                 x=READLN("g")+xx
  204.                 y=READLN("g")+yy
  205.                 pp_AddPoly x y
  206.             END
  207.  
  208.             IF Ptr=15 then DO
  209.                 pp_EndPoly
  210.             END;ELSE;DO
  211.                 pp_EndPolyF
  212.             END
  213.             call close(file)
  214.         END
  215.     END
  216. END    
  217.  
  218. IF Ptr=17|Ptr=18 then DO
  219.     pp_DialogInit 150 75 "*Bezier*" 2
  220.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  221.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  222.     pp_Dialog
  223.  
  224.     IF result~=0 then DO
  225.         pp_GetDialog 0;xx=result
  226.         pp_GetDialog 1;yy=result
  227.  
  228.         file="T:ppdata"
  229.         IF OPEN("g",file, "read") then DO
  230.             tind = READLN("g")
  231.             pp_StartPoly
  232.             DO i=1 to tind
  233.                 x=READLN("g")+xx
  234.                 y=READLN("g")+yy
  235.                 pp_AddPoly x y
  236.             END
  237.             IF Ptr=17 then DO
  238.                 pp_EndPolyS
  239.             END;ELSE;DO
  240.                 pp_EndPolySF
  241.             END
  242.             call close(file)
  243.         END
  244.     END
  245. END
  246.  
  247. IF Ptr=9 then DO
  248.     pp_DialogInit 150 75 "*Draw*Point*" 2
  249.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  250.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  251.     pp_Dialog
  252.  
  253.     IF result~=0 then DO
  254.         pp_GetDialog 0;xx=result
  255.         pp_GetDialog 1;yy=result
  256.  
  257.         file="T:ppdata"
  258.         IF OPEN("g",file, "read") then DO
  259.           tind = READLN("g")
  260.             pp_StartPoly
  261.             DO i=1 to tind
  262.                 x=READLN("g")+xx
  263.                 y=READLN("g")+yy
  264.                 pp_AddPoly x y
  265.             END
  266.             pp_EndPoint
  267.             call close(file)
  268.         END
  269.     END
  270. END
  271.  
  272. IF Ptr=10|Ptr=11|Ptr=23 then DO
  273.     pp_DialogInit 150 75 "*Free*Draw*" 2
  274.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  275.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  276.     pp_Dialog
  277.  
  278.     IF result~=0 then DO
  279.         pp_GetDialog 0;xx=result
  280.         pp_GetDialog 1;yy=result
  281.  
  282.         file="T:ppdata"
  283.         IF OPEN("g",file, "read") then DO
  284.             tind = READLN("g")
  285.             pp_StartPoly
  286.             DO i=1 to tind
  287.                 x=READLN("g")+xx
  288.                 y=READLN("g")+yy
  289.                 pp_AddPoly x y
  290.             END
  291.             IF Ptr=10 then DO
  292.                 pp_EndPointL
  293.             END;ELSE;DO
  294.                 pp_EndPointLF
  295.             END
  296.             call close(file)
  297.         END
  298.     END
  299. END
  300.  
  301. pp_PermitRefresh
  302. pp_CloneObjectModeOff
  303.  
  304. EXIT
  305.     
  306.  
  307.